'use server';
import { db } from "@/lib/db";


export const getBriefs = async (secuCode) => {
    const results = await db.$queryRaw`
    select secu_code,secu_name ,brief_title ,brief_reason ,brief_source ,brief_date from (
      select row_number() over (partition by secu_code,brief_source order by brief_date desc) as rn, secu_code,secu_name ,brief_title ,brief_reason ,brief_source ,brief_date  from tb_brief
    )where rn=1 and secu_code=${secuCode}
  `;
    return results;
};
